package comday03.itheima02;

public class Demo05 {
    public static void main(String[] args) {

        //我们以后见的很多的循环操作就是 求和 和求个数

        //求1-100之间的偶数的数据之和
        int sum = 0;

        for (int i = 1; i <= 100; i++) {
            if(i%2 == 0){
                sum += i;
            }
        }

        System.out.println(sum);


        //求1-100之前的偶数有几个
        int count = 0;

        for (int i = 1; i <= 100; i++) {
            if(i%2 == 0){
                count++;
            }
        }

        System.out.println(count);

    }
}
